<template>
  <div>
    <List :nameList="nameList">
      <template #header>
          <h2 class="header">0516学生列表</h2>
      </template>
      <template #nameItem="{person}">
        <li >
          {{person.name}} ----  {{person.age}}
          </li>
      </template>
    </List>
  </div>
</template>

<script>
import List from '@/components/List'
export default {
  name:"App",
  components:{
    
    List,
  },
  data(){
    return {
      nameList:[
        {id:"001",name:"张三",age:20},
        {id:"002",name:"张四",age:21},
        {id:"003",name:"张五",age:22},
        {id:"004",name:"张六",age:23},
        {id:"005",name:"张七",age:24}
      
      ]
    }
  }
}
</script>

<style>
.header{
  background: skyblue;
}
</style>